const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const {
  ElementPlusResolver
} = require('unplugin-vue-components/resolvers')
const ElementPlus = require('unplugin-element-plus/webpack')
module.exports = {
  devServer: {
    port: 8081, // 此处修改你想要的端口号
    allowedHosts: "all",
  },
  publicPath: process.env.NODE_ENV === "production" ? "./" : "./",
  outputDir: './dist', // 打包导出地址
  configureWebpack: {
    resolve: {
      alias: {
        views: '@/views'
      }
    },
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver({
          importStyle: false
        })],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
      ElementPlus({
        useSource: true,
      }),
    ],
  },
  css: {
    loaderOptions: {
      scss: {
        additionalData: `@use "~/src/assets/css/element/element.scss" as *;`,
      },
    },
  },
}